<?LassoScript

	define_tag('param2vars',
	-nameSpace='er_',
	-priority='replace');
	
	// converts form params to vars of the same name
	// example: fomr elemetn named email woudl create a var named email with it's value
	
	local('return'=string);
	local('thisParam' = '');
	iterate(client_postParams, #return);
		
		if(!#return->first->beginswith('__') && !#return->first->beginswith('-'));
			// account for form parameters that have \r in them, we have to rebuild those vars from the param map
			if(#thisParam !=#return->first);
				var(#return->first=#return->second);
			else;
				var(#return->first) += '\r'+#return->second;
			/if;
			
		/if;
		#thisParam =#return->first;
	/iterate;

/define_tag;

?>

